package com.shuai.common.constant;

public enum GenderEnum {
    MALE(0, "男"),
    FEMALE(1, "女"),
    UNDISCLOSED(2, "不愿透露");

    private final int code;
    private final String description;

    GenderEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // Optional: Method to get Gender enum from code
    public static GenderEnum fromCode(int code) {
        for (GenderEnum genderEnum : GenderEnum.values()) {
            if (genderEnum.getCode() == code) {
                return genderEnum;
            }
        }
        throw new IllegalArgumentException("Invalid Gender code: " + code);
    }
}
